package com.method.chongzai;

/*
需求：使用方法重载的思想，设计比较两个整数是否相同的方法，兼容全整数类型（ byte,short,int,long）
 */
public class Demo01 {
    public static void main(String[] args) {
       int a =10;
       int b =20;
        System.out.println(compare( a, b));
        byte j = 10;
        byte k = 20;
        System.out.println(compare(j,k));
        short c = 3;
        short d = 3;
        System.out.println(compare(c,d));
        long f = 100000L;
        long g = 100000L;
        System.out.println((compare(f,g)));
    }

    public static boolean compare(int a, int b) {
            return a == b;
    }

    public static boolean compare(byte a, byte b) {
        return a == b;
    }

    public static boolean compare(short a, short b) {
        return a == b;
    }

    public static boolean compare(long a, long b) {
        return a == b;
    }
}
